#!/usr/bin/python
#coding=utf-8

import urllib
import hashlib

def singleton(cls, *args, **kw):  
    instances = {}  
    def _singleton():  
        if cls not in instances:  
            instances[cls] = cls(*args, **kw)  
        return instances[cls]  
    return _singleton  


def unquote(string):
    return urllib.unquote(string)


def md5(passwd, salt='netease'):
    return hashlib.md5(passwd.lower()+salt).hexdigest()   



